﻿using System;
using GeoAPI.Geometries;

namespace YJKGridTopologyCal.EdgeGraph
{
	public class MarkHalfEdge : HalfEdge
	{
		public static bool IsMarked(HalfEdge e)
		{
			return ((MarkHalfEdge)e).Marked;
		}

		public static void Mark(HalfEdge e)
		{
			((MarkHalfEdge)e).Mark();
		}

		public static void SetMark(HalfEdge e, bool isMarked)
		{
			((MarkHalfEdge)e).Marked = isMarked;
		}

		public static void SetMarkBoth(HalfEdge e, bool isMarked)
		{
			((MarkHalfEdge)e).Marked = isMarked;
			((MarkHalfEdge)e.Sym).Marked = isMarked;
		}

		public static void MarkBoth(HalfEdge e)
		{
			((MarkHalfEdge)e).Mark();
			((MarkHalfEdge)e.Sym).Mark();
		}

		public MarkHalfEdge(Coordinate orig) : base(orig)
		{
		}

		public void Mark()
		{
			this.Marked = true;
		}

		public bool Marked
		{
			get
			{
				return this._marked;
			}
			set
			{
				this._marked = value;
			}
		}

		private bool _marked;
	}
}
